<?php
# $Id: default_index.tmpl.php,v 1.3 2006/06/22 14:45:39 diegor Exp $
require('header.php');
$auth = $user->getAttribute('auth');
$stats = $template['stats'];
$posts = $template['posts'];
$logged = $template['logged'];
?>
<script language="javascript" src="<?=WEB_MODULE_DIR?>js/shoutbox/js/jquery.js" type="text/javascript"></script>
<script language="javascript" src="<?=WEB_MODULE_DIR?>js/shoutbox/js/yshout.js" type="text/javascript"></script>
<script type="text/javascript">
new YShout({
	   yPath: 'http://localhost/shoutbox/',
	   log: 1
	});

</script>
<script language="javascript">
function submitthis()
{
    document.adminForm.submit();
}
</script>
<div id="content-box">
  <div class="padding">
    <div id="element-box">
      <div class="t">
        <div class="t">
          <div class="t"></div>
        </div>
      </div>
      <div class="m">
       <!-- <table class="adminheading">
          <tr>
            <th class="cpanel" rowspan="2" nowrap>Control Panel&nbsp;<font size="1px" color="#CCCCCC">[<?=strtoupper($auth['privilege'])?>]</font></th>
          </tr>
        </table>-->
        <table class="adminform">
          <tr>
          <!-- SYSTEM SHORTCUTS  -->
            <td width="50%" valign="top">
              <div id="cpanel">
                <div style="float: left">
                  <div class="icon">
                    <a class="toolbar" href="?module=<?=DEFAULT_MODULE?>&action=AddressBook">
                      <img src="<?=WEB_MODULE_DIR?>images/generic.png" align="middle" name="new" border="0"><br>Contact Manager
                    </a>
                  </div>
                </div>
                <div style="float: left">
                  <div class="icon">
                    <a class="toolbar" href="?module=<?=DEFAULT_MODULE?>&action=GroupManagement">
                      <img src="<?=WEB_MODULE_DIR?>images/user.png" align="middle" name="new" border="0"><br>Group Manager
                    </a>
                  </div>
                </div>
                <div style="float: left">
                  <div class="icon">
                    <a class="toolbar" href="?module=<?=DEFAULT_MODULE?>&action=TemplateEditor">
                      <img src="<?=WEB_MODULE_DIR?>images/addedit.png" align="middle" name="new" border="0"><br>Template Editor
                    </a>
                  </div>
                </div>
                <div style="float: left">
                  <div class="icon">
                    <a class="toolbar" href="?module=<?=DEFAULT_MODULE?>&action=PresetMessages">
                      <img src="<?=WEB_MODULE_DIR?>images/addedit.png" align="middle" name="new" border="0"><br>Preset Messages
                    </a>
                  </div>
                </div>
                <div style="float: left">
                  <div class="icon">
                    <a class="toolbar" href="?module=<?=DEFAULT_MODULE?>&action=Transaction">
                      <img src="<?=WEB_MODULE_DIR?>images/categories.png" align="middle" name="new" border="0"><br>Transaction Manager
                    </a>
                  </div>
                </div>
                <div style="float: left">
                  <div class="icon">
                    <a class="toolbar" href="?module=<?=DEFAULT_MODULE?>&action=Poll">
                      <img src="<?=WEB_MODULE_DIR?>images/poll.png" align="middle" name="new" border="0"><br>Poll Messaging
                    </a>
                  </div>
                </div>
                <div style="float: left">
                  <div class="icon">
                    <a class="toolbar" href="?module=<?=DEFAULT_MODULE?>&action=Maintenance">
                      <img src="<?=WEB_MODULE_DIR?>images/systeminfo.png" align="middle" name="new" border="0"><br>Maintenance
                    </a>
                  </div>
                </div>
                <div style="float: left">
                  <div class="icon">
                    <a class="toolbar" href="?module=<?=DEFAULT_MODULE?>&action=PollIndex">
                      <img src="<?=WEB_MODULE_DIR?>images/langmanager.png" align="middle" name="new" border="0"><br>Poll
                    </a>
                  </div>
                </div>
              </div>
            </td>
            <!-- BOARDS AND ANNOUNCEMENTS  -->
            <td width="50%" valign="top">
              <div class="tab-page" id="modules-cpanel">
                <script type="text/javascript">
                  var tabPane1 = new WebFXTabPane( document.getElementById( "modules-cpanel" ), 1 )
                </script>
                <div class="tab-page" id="tab1ElementId">
                  <h2 class="tab">Events</h2>
                  <script type="text/javascript">
                    tabPane1.addTabPage( document.getElementById( "tab1ElementId" ) );
                  </script>
                  <!-- List of Enrolled Student -->
                  <table class="adminlist">
                    <tr>
                      <th colspan="22">Message Board</th>
                    </tr>
                    <tr>
                      <td><div id="yshout"></div></td>
                    </tr>
                  </table>
                </div> 
                <div class="tab-page" id="tab1ElementId">
                  <h2 class="tab">Logged</h2>
                  <script type="text/javascript">
                    tabPane1.addTabPage( document.getElementById( "tab1ElementId" ) );
                  </script>
                  <!-- CURRENTLY LOGGED IN USERS -->
                  <table class="adminlist">
                    <tr>
                      <th colspan="22">Currently Logged In Users</th>
                    </tr>
                    <?php
                      if ($logged)
                        foreach ($logged as $id => $log) {
                          $color = ($id/2 == round($id/2)) ? "row0" : "row1";
                    ?>
                    <tr class="<?=$color?>">
                      <td width="30%"><?= $log['login'];?></td>
                      <td align="center"><?= $log['privilege'];?></td>
                    </tr>
                    <?php
                      }else{
                    ?>
                    <tr>
                      <td colspan="2">No online users</td>
                    </tr>
                    <?php
                      }
                    ?>
                  </table>
                </div>
              </div>
            </td>
          </tr>
          </tr>
        </table>
      </div>
      <div class="b">
        <div class="b">
          <div class="b"></div>
        </div>
      </div>
    </div>
    <div class="clr"></div>
  </div>
</div>
  <div id="border-bottom"><div><div></div></div>
</div>            
<br>
<?php require('footer.php'); ?>
</body>
